﻿#ifndef QANTENNA_H
#define QANTENNA_H

#include <QWidget>
#include <QPainter>
#include <QMouseEvent>
#include "globaldata.h"

class QAntenna : public QWidget
{
    Q_OBJECT
public:
    explicit QAntenna(QWidget *parent = nullptr);

     void paintEvent(QPaintEvent *);

     //void mouseDoubleClickEvent(QMouseEvent *e);
     //void mousePressEvent(QMouseEvent *e);
     void mouseReleaseEvent(QMouseEvent *e);

signals:
     void updateRound();
     void updateRound2();
     void Light(int);
     void work(bool);
public slots:
     void ZDPath();
     void ZDBPath();
     void drawLine(QPainter& painter);
     void drawRound(QPainter& painter);
     void drawCurve(QPainter& painter,bool a);
     void drawCurve1(QPainter& painter,bool a);
     bool isContains(QPoint p);
     bool isContainsB(QPoint p);
     void isLeft(QPoint p);
     void isRight(QPoint p);
     void drawLine1(QPainter& painter,bool a);
     void drawLine2(QPainter& painter,bool a);
     void drawLine3(QPainter& painter,bool a);
     void drawLine4(QPainter& painter,bool a);
     void updateLine(QString Kw,bool a,bool b);
     void defeatedJX();
     void defeatedZY();
public:
     GlobalData *globadata;
     double m_width;
     double m_height;
     QPoint center1;
     QPoint center2;
     bool   ZD=true;
     bool   ZDB=true;
     bool   line1;
     bool   line2;
     bool   line3;
     bool   line4;
     QWidget *wid;
     QWidget *widget;
     int    point_width;

};

#endif // QANTENNA_H
